import Vue from 'vue'
import Router from 'vue-router'
import CardDetail from '@/pages/CardDetail'
import DayCard from '@/pages/DayCard'
import MonthCard from '@/pages/MonthCard'
import PersonCard from '@/pages/PersonCard'
import Card from '@/pages/Card'
import UserList from '@/pages/CardUserList'
import DayDetail from '@/pages/DayDetail'
import DayCalendar from '@/pages/DayCalendar'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: "/",
            name: "Card",
            meta: {
                title: "考勤打卡"
            },
            redirect: "/detail",
            component: Card
        },
        {
          path:"/detail/month/list",
          name:"CardUserList",
          meta:{
              title:"统计详情"
          },
          component:  UserList
        },
        {
            path:"/detail/day/list",
            name:"DayDetail",
            meta:{
                title:"打卡明细"
            },
            component:  DayDetail
        },
        {
            path:"/detail/day/calendar",
            name:"DayDetail",
            meta:{
                title:"考勤日历"
            },
            component:  DayCalendar
        },
        {
            path: '/detail',
            name: 'CardDetail',
            meta: {
                title: "考勤统计"
            },
            redirect: "/detail/person",
            component: CardDetail,
            children: [
                {
                    path: '/detail/day',
                    name: "DayCard",
                    meta: {
                        title: "考勤统计"
                    },
                    component: DayCard,
                },
                {
                    path: '/detail/month',
                    name: "MonthCard",
                    meta: {
                        title: "考勤统计"
                    },
                    component: MonthCard,
                },
                {
                    path: '/detail/person',
                    name: "PersonCard",
                    meta: {
                        title: "考勤统计"
                    },
                    component: PersonCard,
                }
            ]
        }
    ]
})
